3.18 \(\int \csc (e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=52 \[ \frac{b (2 a+b) \sec (e+f x)}{f}-\frac{(a+b)^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]

[Out]

-(((a + b)^2*ArcTanh[Cos[e + f*x]])/f) + (b*(2*a + b)*Sec[e + f*x])/f + (b^2*Sec[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0657563, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4133, 461, 207} \[ \frac{b (2 a+b) \sec (e+f x)}{f}-\frac{(a+b)^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-(((a + b)^2*ArcTanh[Cos[e + f*x]])/f) + (b*(2*a + b)*Sec[e + f*x])/f + (b^2*Sec[e + f*x]^3)/(3*f)

Rule 4133

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*(ff*x)^n)^p)/(ff*x)^(n*
p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rule 461

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[((e*x)^m*(a + b*x^n)^p)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (b+a x^2\right )^2}{x^4 \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{b^2}{x^4}+\frac{b (2 a+b)}{x^2}-\frac{(a+b)^2}{-1+x^2}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac{b (2 a+b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}+\frac{(a+b)^2 \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{(a+b)^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b (2 a+b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [B]  time = 0.531735, size = 108, normalized size = 2.08 \[ -\frac{4 \sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (-3 b (2 a+b) \cos ^2(e+f x)+3 (a+b)^2 \cos ^3(e+f x) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )-b^2\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(-4*(b + a*Cos[e + f*x]^2)^2*(-b^2 - 3*b*(2*a + b)*Cos[e + f*x]^2 + 3*(a + b)^2*Cos[e + f*x]^3*(Log[Cos[(e + f
*x)/2]] - Log[Sin[(e + f*x)/2]]))*Sec[e + f*x]^3)/(3*f*(a + 2*b + a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

Maple [B]  time = 0.05, size = 117, normalized size = 2.3 \begin{align*}{\frac{{a}^{2}\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}+2\,{\frac{ab}{f\cos \left ( fx+e \right ) }}+2\,{\frac{ab\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}}{3\,f \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}+{\frac{{b}^{2}}{f\cos \left ( fx+e \right ) }}+{\frac{{b}^{2}\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/f*a^2*ln(csc(f*x+e)-cot(f*x+e))+2/f*a*b/cos(f*x+e)+2/f*a*b*ln(csc(f*x+e)-cot(f*x+e))+1/3/f*b^2/cos(f*x+e)^3+
1/f*b^2/cos(f*x+e)+1/f*b^2*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.02123, size = 111, normalized size = 2.13 \begin{align*} -\frac{3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left (3 \,{\left (2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}\right )}}{\cos \left (f x + e\right )^{3}}}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/6*(3*(a^2 + 2*a*b + b^2)*log(cos(f*x + e) + 1) - 3*(a^2 + 2*a*b + b^2)*log(cos(f*x + e) - 1) - 2*(3*(2*a*b
+ b^2)*cos(f*x + e)^2 + b^2)/cos(f*x + e)^3)/f

________________________________________________________________________________________

Fricas [A]  time = 0.516601, size = 271, normalized size = 5.21 \begin{align*} -\frac{3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 6 \,{\left (2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}}{6 \, f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/6*(3*(a^2 + 2*a*b + b^2)*cos(f*x + e)^3*log(1/2*cos(f*x + e) + 1/2) - 3*(a^2 + 2*a*b + b^2)*cos(f*x + e)^3*
log(-1/2*cos(f*x + e) + 1/2) - 6*(2*a*b + b^2)*cos(f*x + e)^2 - 2*b^2)/(f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.29312, size = 244, normalized size = 4.69 \begin{align*} \frac{3 \,{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{8 \,{\left (3 \, a b + 2 \, b^{2} + \frac{6 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{3 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{3 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{3 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}{{\left (\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{3}}}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/6*(3*(a^2 + 2*a*b + b^2)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 8*(3*a*b + 2*b^2 + 6*a*b*(cos(f*x + e
) - 1)/(cos(f*x + e) + 1) + 3*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 3*a*b*(cos(f*x + e) - 1)^2/(cos(f*x
+ e) + 1)^2 + 3*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)^3)/
f